package belf.migrate.api.taskconf;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.*;


@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ColumnSyncConf {
    @JsonProperty("column")
    private String columnName;

    @JsonProperty("readRule")
    private ColumnRule readRule;

    @JsonProperty("writeRule")
    private ColumnRule writeRule;

    private String tableName;


    public String toJson() throws JsonProcessingException {
        ObjectMapper mapper = new ObjectMapper();
        return mapper.writer().writeValueAsString(this);
    }


}
